package com.ruoyi.monitor.controller;



import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.monitor.service.MonitorService;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @desc: 监控设备管理
 * @author：cc
 * @date: 2024/7/23
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/monitor")
public class MonitorController {

    private static final Logger log = LoggerFactory.getLogger(MonitorController.class);
    private final MonitorService monitorService;

    @GetMapping("/token")
    @ApiOperation("获取token")
    public AjaxResult getAccessToken() throws Exception {
        String token = monitorService.getAccessToken();
        return AjaxResult.success(token);
    }
    @GetMapping("/equipmentToken")
    public AjaxResult getToken() throws Exception{
        String token = monitorService.getToken();
        log.info("获取到的token"+token);
        return AjaxResult.success(token);
    }

}
